<?php echo $this->Form->create('Post', array('type' => 'file', 'class' => 'form-style' )); ?>
	<?php
		echo $this->Form->input('rtype', array('options' => $types, 'label' => 'Loại bài viết'));
		echo $this->Form->input('topic', array(	'empty'=> 'Vui lòng chọn', 
																						'options' => $topics, 
																						'selected' => '', 
																						'label' => 'Chủ đề', 
																						'div' => 'topic-dv', 'disabled' => true));
		echo $this->Form->input('title', array('label' => 'Tiêu đề'));
		echo $this->Form->input('description', array('label' => 'Tóm tắt'));
		echo $this->Form->input('content', array('label' => 'Nội dung','class' => 'mceEditor'));
		echo $this->Form->input('tags');
    echo $this->Form->input('image', array('label' => 'Hình đại diện','type' => 'file'));
    echo $this->Form->input('dir', array('type' => 'hidden'));
    echo $this->Form->input('mimetype', array('type' => 'hidden'));
    echo $this->Form->input('filesize', array('type' => 'hidden'));
	?>
<?php echo $this->Form->end(__('Submit')); ?>

<?php $this->start('script') ?>
	<style>
		.topic-dv{display:none;}
	</style>
<?php $this->end(); ?>

<?php $this->start('script') ?>
	<?php echo $this->Html->script('tiny_mce/tiny_mce'); ?>
	<?php echo $this->Html->script('tinymce.custom'); ?>
	<script type="text/javascript">
		$(document).ready(function(){
			$('#PostRtype').change(function(){
				if($(this).val() == <?php echo Post::consult; ?>){
					$('.topic-dv').show();
					$('#PostTopic').attr('disabled', false);
				}else{
					$('.topic-dv').hide();
					$('#PostTopic').attr('disabled', true);
				}
			});
		});
	</script>
<?php $this->end(); ?>

